package com.qf.controller;

import com.qf.UserService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 千锋教育
 * @Company http://www.mobiletrain.org/
 * @Version 1.0
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @DubboReference
    UserService userService;

    @RequestMapping("/login")
    public String login(String username ,String password) {
        //远程调用 ：调用提供者的 service方法
        boolean flag = userService.login(username, password);
        if(flag) {
            return "success";
        }else {
            return "error";
        }
    }
}
